<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>变量与常量</title>
</head>
<body>
    <script>
        var a = 1;
        var b = 3.14;
        var c ='你们';
        var d ="好呀";
        var e =true;
        console.log(a,b,c,d,e);
        console.log(typeof(a),typeof(b),typeof(c),typeof(d),typeof(e));
        a=3.14;
        console.log(a,typeof(a));
        a=false;
        console.log(a,typeof(a));
        //JS中用var可以重复声明变量
        var a = "哈哈哈我又来啦";
        console.log(a,typeof(a));

        let x =1;
        console.log(x,typeof(x));
        x=6.6;
        console.log(x,typeof (x));
        // let x=true;//报错:x已被声明
        // console.log(x,typeof (x));

        //声明常量
        const y =1;
        console.log(y);
        //y=33;//常量的值不允许修改
    </script>
</body>
</html>